package com.DHH.Service.Base.Impl;
import com.DHH.Entity.Base.BaseUserGroup;
import com.DHH.Mapper.Base.BaseUserGroupMapper;
import com.DHH.Service.Base.IBaseUserGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BaseUserGroupServiceImpl implements IBaseUserGroupService{
	
	@Autowired
    private BaseUserGroupMapper baseUserGroupMapper;
    
   @Override
   public BaseUserGroup insertBaseUserGroup(BaseUserGroup baseUserGroup){
	   
        baseUserGroupMapper.insertSelective(baseUserGroup);
	   return baseUserGroup;
	   
   };
   @Override
   public BaseUserGroup updateBaseUserGroup(BaseUserGroup baseUserGroup){
	     baseUserGroupMapper.updateByPrimaryKeySelective(baseUserGroup);
        return baseUserGroup;
   };
   @Override
   public BaseUserGroup deleteBaseUserGroup(BaseUserGroup baseUserGroup){

	     baseUserGroupMapper.delete(baseUserGroup);
        return baseUserGroup;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public BaseUserGroup saveOrUpdateBaseUserGroup(BaseUserGroup baseUserGroup){
        if(baseUserGroup.getId()==null)
        {
            baseUserGroupMapper.insertSelective(baseUserGroup);
        }else{
            baseUserGroupMapper.updateByPrimaryKeySelective(baseUserGroup);
        }
        return baseUserGroup;
    };
}
